

<style>
  table.table{
    border:1px solid #000;
    font-size:12px;
    width:100%;
  }
  table{
    border-collapse:collapse;
    width:100%;
  }
  table.table tr td{
    border:1px solid #000;
    padding:2px 6px;
  }
  a{
    color:#000;
    text-decoration: none
  }
</style>

<table>
  <tr>
    <td style="font-size:20; text-align:center;font-weight:bold;"><?=$school_name;?></td>
  </tr>
  <tr>
    <td style="font-size:12px; text-align:center;font-weight:bold;">LIST OF ENROLLED STUDENT(S)</td>
  </tr>
  <tr>
    <td style="font-size:12px; text-align:center;font-weight:bold;">School Year: <?=$school_year;?></td>
  </tr>
  <tr>
    <td style="font-size:12px; text-align:center;font-weight:bold;"><?=$print_title;?></td>
  </tr>
</table>

<table class="table table-striped table-hover">
  <thead>
    <tr>
      <td>STUDENT ID</td>
      <td>STUDENT NAME</td>
      <td>DATE ENROLLED</td>
      <td>GENDER</td>
    </tr>
  </thead>
    <?if($sml):?>
      <!-- Loop grade level start -->
      <?foreach($sml as $k => $v):?>
      <tbody>
          <tr>
            <td colspan="4" style="text-align:center;"><?=$v['level'];?></td>
          </tr>
        <!-- Loop grade level sections start -->
        <?if(!empty($v['data'])):?>
          <?if(!empty($v['data'])):?> 
            <!-- Loop grade level section students start -->
            <?foreach($v['data'] as $dk => $dv):?>
              <tr class="success">
                <td colspan="4" class="center" ><div id="<?=$dv['id'];?>"></div><span class="label label-inverse"><?=$dv['section_name'];?></span></td>
              </tr>
            <?if(!empty($dv['students'])):?>
              <?foreach($dv['students'] as $stud):?>
              <tr>
                <td><?=$stud->e_student_id;?></td>
                <td><a href="<?=site_url('profile/student/'.$stud->enrollment_id);?>" target="_blank"><?=ucwords(strtolower($stud->fullname));?></a></td>
                <td><?=$stud->regdate;?></td>
                <td><?=$stud->gender;?></td>
              </tr>
              <?endforeach;?>
            <?else:?>
              <tr>
                <td colspan="4">No Students.</td>
              </tr>
            <?endif;?>
            <!-- Loop grade level section students end-->
            <?endforeach;?>
          <?else:?>
            <tr><td colspan="4">No Students.</td></tr>
          <?endif?>
        <!-- Loop grade level sections end -->
        <?else:?>
          <tr><td colspan="4">There are no sections for this grade Level</td></tr>
        <?endif;?>
      <!-- Loop grade level start -->
      <?endforeach;?>
    <?else:?>
      <tr><td colspan="4">No Data to show.</td></tr>
    <?endif;?>
  </tbody>
</table>